package com.sdx.console.orgmain.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.orgmain.dao.OrgMainDao;
import com.sdx.console.orgmain.entity.OrgMain;
import com.ibeetl.admin.core.service.BaseService;

/**
 * orgmain Service
 */

@Service
@Transactional
public class OrgMainService extends BaseService<OrgMain>{

    @Resource
	private OrgMainDao orgmainDao;

    public PageQuery<OrgMain>queryByCondition(PageQuery query){
        PageQuery ret =  orgmainDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelOrgMain(List<String> ids){
        try {
            orgmainDao.batchDelOrgMainByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除orgmain失败", e);
        }
    }

	public List<OrgMain> all() {
		return orgmainDao.all();
		}
}